package org.example.controller;

import org.example.entity.dto.ProjectVersionCompareDTO;
import org.example.entity.vo.CompareDetailVo;
import org.example.service.ProjectVersionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("test")
public class TestController {

    @Resource
    private ProjectVersionService projectVersionService;

    @PostMapping("create")
    public String createVersion(String versionNo){
        projectVersionService.createVersion(versionNo);
        return versionNo;
    }

    @GetMapping("compare")
    public List<Long> compare(Long currentId,Long historyId){
        return projectVersionService.compare(currentId,historyId);
    }

    @GetMapping("compare/detail")
    public List<CompareDetailVo> compareDetail(ProjectVersionCompareDTO dto){
        return projectVersionService.compareDetail(dto);
    }
}
